package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.security.PrivateKey;

/**
 * Created by tang on 2018/7/23.
 */

public class SysMsgInfo implements Parcelable,Serializable, DateInfo {
    private String createdTime; //日期;
    private String title; //标题
    private String message; //具体消息内容
    private String dtime; //时间点
    private String state; //返回消息图片标识

    protected SysMsgInfo(Parcel in) {
        createdTime = in.readString();
        title = in.readString();
        message = in.readString();
        dtime = in.readString();
        state = in.readString();
    }

    public SysMsgInfo(String createdTime, String title, String message, String dtime, String state) {
        this.createdTime = createdTime;
        this.title = title;
        this.message = message;
        this.dtime = dtime;
        this.state = state;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(createdTime);
        dest.writeString(title);
        dest.writeString(message);
        dest.writeString(dtime);
        dest.writeString(state);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<SysMsgInfo> CREATOR = new Creator<SysMsgInfo>() {
        @Override
        public SysMsgInfo createFromParcel(Parcel in) {
            return new SysMsgInfo(in);
        }

        @Override
        public SysMsgInfo[] newArray(int size) {
            return new SysMsgInfo[size];
        }
    };

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getDtime() {
        return dtime;
    }

    public void setDtime(String dtime) {
        this.dtime = dtime;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "SysMsgInfo{" +
                "createdTime='" + createdTime + '\'' +
                ", title='" + title + '\'' +
                ", message='" + message + '\'' +
                ", dtime='" + dtime + '\'' +
                ", state='" + state + '\'' +
                '}';
    }

    @Override
    public long getDate() {
        return Long.parseLong(createdTime);
    }
}
